home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-12-07 | 6.8 KB | 341 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- #
- # Apple Products Presents
- #
- # S U R F E R ----- A CommToolbox Sample Application
- # by Alex Kazim
- #
- # Based on the MacDTS Simple Sample Application
- #
- # Surfer.r - Rez Source
- #
- # Copyright © 1988-9 Apple Computer, Inc.
- # All rights reserved.
- #
- # Versions: Sample 1.0 08/88
- # Sample 1.01 11/88
- # Surfer 0.5 08/89
- ------------------------------------------------------------------------------*/
-
-
- #include "Types.r"
- #include "SysTypes.r"
- #include "Surferplus.h"
-
-
- /* So the Finder can tell who we are */
-
- resource 'vers' (1) {
- 0x01,
- 0x00,
- development,
- 0x12,
- verUS,
- "1.0D1",
- "1.0D1, Copyright © Apple Computer, Inc. 1988-1989. Written by Alex Kazim"
- };
-
-
- /* we use an MBAR resource to conveniently load all the menus */
-
- resource 'MBAR' (rMenuBar, preload) {
- { mApple, mFile, mEdit, mSettings }; /* four menus */
- };
-
-
- resource 'MENU' (mApple, preload) {
- mApple, textMenuProc,
- AllItems & ~MenuItem2, /* Disable dashed line, enable About and DAs */
- enabled, apple,
- {
- "About Surfer…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mFile, preload) {
- mFile, textMenuProc,
- MenuItem15, /* enable Quit only, program enables others */
- enabled, "File",
- {
- "New",
- noicon, "N", nomark, plain;
- "Open",
- noicon, "O", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Close",
- noicon, "W", nomark, plain;
- "Save",
- noicon, "S", nomark, plain;
- "Save As…",
- noicon, nokey, nomark, plain;
- "Revert",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Send File",
- noicon, "T", nomark, plain;
- "Receive File",
- noicon, "R", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Page Setup…",
- noicon, nokey, nomark, plain;
- "Print…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Quit",
- noicon, "Q", nomark, plain
- }
- };
-
- resource 'MENU' (mEdit, preload) {
- mEdit, textMenuProc,
- NoItems, /* disable everything, program does the enabling */
- enabled, "Edit",
- {
- "Undo",
- noicon, "Z", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Cut",
- noicon, "X", nomark, plain;
- "Copy",
- noicon, "C", nomark, plain;
- "Paste",
- noicon, "V", nomark, plain;
- "Clear",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mSettings, preload) {
- mSettings, textMenuProc,
- NoItems, /* disable everything, program does the enabling */
- enabled, "Settings",
- {
- "Connection…",
- noicon, "1", nomark, plain;
- "File Transfer…",
- noicon, "2", nomark, plain;
- "Terminal…",
- noicon, "3", nomark, plain
- }
- };
-
-
- /* this ALRT and DITL are used as an About screen */
-
- resource 'ALRT' (rAboutAlert, purgeable) {
- {40, 20, 180, 400},
- rAboutAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
- resource 'DITL' (rAboutAlert, purgeable) {
- { /* array DITLarray: 5 elements */
- /* [1] */
- {99, 285, 119, 365},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {8, 8, 26, 250},
- StaticText {
- disabled,
- "SURFER: A CommToolbox Application"
- },
- /* [3] */
- {103, 6, 120, 251},
- StaticText {
- disabled,
- "Copyright © 1988-9 Apple Computer"
- },
- /* [4] */
- {52, 8, 69, 260},
- StaticText {
- disabled,
- "Bytes by Alex & Mary, Words by Rob"
- },
- /* [5] */
- {86, 6, 103, 211},
- StaticText {
- disabled,
- "Based on Sample from MacDTS"
- }
- }
- };
-
-
- /* this ALRT and DITL are used as an error screen */
-
- resource 'ALRT' (rUserAlert, purgeable) {
- {40, 20, 180, 350},
- rUserAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
-
- resource 'DITL' (rUserAlert, purgeable) {
- { /* array DITLarray: 3 elements */
- /* [1] */
- {100, 230, 120, 310},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {10, 60, 76, 310},
- StaticText {
- disabled,
- "^0"
- },
- /* [3] */
- {8, 8, 40, 40},
- Icon {
- disabled,
- 2
- }
- }
- };
-
-
- resource 'WIND' (rWindow, preload, purgeable) {
- {40, 5, 340, 512},
- documentProc, visible, noGoAway, 0x0, "Surf the Wave"
- };
-
-
- /* we put the latest SIZE template here so we can rez with MPW 2.0 */
-
- type 'SIZE' {
- boolean dontSaveScreen,
- saveScreen;
- boolean ignoreSuspendResumeEvents,
- acceptSuspendResumeEvents;
- boolean enableOptionSwitch,
- disableOptionSwitch;
- boolean cannotBackground,
- canBackground;
- boolean notMultiFinderAware,
- multiFinderAware;
- boolean notOnlyBackground,
- onlyBackground;
- boolean dontGetFrontClicks,
- getFrontClicks;
- unsigned bitstring[9] = 0;
- unsigned longint; /* preferred memory size in bytes */
- unsigned longint; /* minimum memory size in bytes */
- }; /* ignore the warning caused by re-defining SIZE */
-
-
- /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
-
- resource 'SIZE' (-1) {
- dontSaveScreen,
- acceptSuspendResumeEvents,
- enableOptionSwitch,
- canBackground, /* we can background; we don't currently, but our sleep value */
- /* guarantees we don't hog the Mac while we are in the background */
- multiFinderAware, /* this says we do our own activate/deactivate; don't fake us out */
- notOnlyBackground, /* this is definitely not a background-only application! */
- dontGetFrontClicks, /* change this is if you want "do first click" behavior like the Finder */
- kPrefSize * 1024,
- kMinSize * 1024
- };
-
- /* vertical and horizontal scroll bars for the window */
- resource 'CNTL' (128) {
- {-1, 492, 286, 508},
- 0,
- visible,
- 0,
- 0,
- scrollBarProc,
- 0,
- "vertical scroll bar"
- };
-
- resource 'CNTL' (129) {
- {285, -1, 301, 493},
- 0,
- visible,
- 0,
- 0,
- scrollBarProc,
- 0,
- "hori scroll bar"
- };
-
-
- resource 'BNDL' (128) {
- 'SurF',
- 0,
- { /* array TypeArray: 2 elements */
- /* [1] */
- 'FREF',
- { /* array IDArray: 1 elements */
- 0, 128
- },
- /* [2] */
- 'ICN#',
- { /* array IDArray: 1 elements */
- 0, 128
- }
- }
- };
-
-
- resource 'ICN#' (128) {
- { /* array: 2 elements */
- /* [1] */
- $"0400 0000 2080 002C 0E02 0050 1107 0000"
- $"514A 8000 110A 8160 0E0A 8290 209A 4000"
- $"0412 4000 0012 5040 0012 4880 0012 4700"
- $"0012 4700 0012 4700 FFF2 777F 0412 4211"
- $"4052 4F80 0012 7FC4 0112 7FC0 4812 4FC0"
- $"0012 4748 0012 4740 0092 4742 2412 4F80"
- $"0012 4D80 0012 4D90 2092 4882 0212 4880"
- $"0012 58C0 200F 98C8 0000 0000 0442 2202",
- /* [2] */
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- }
- };
-
- resource 'FREF' (128) {
- 'APPL',
- 0,
- ""
- };
-
-